Skip to content

Conversation

@fee1-dead
Copy link
Member

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Oct 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 19, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@petrochenkov
Copy link
Contributor

r? @lcnr for review or further reassignment

@rustbot rustbot assigned lcnr and unassigned petrochenkov Oct 20, 2025

pub fn to_host_effect_clause(self, cx: I, constness: BoundConstness) -> I::Clause {
self.map_bound(|trait_ref| {
self.map_bound(|trait_ref: TraitRef<I>| {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a misclick with rust-analyzer


// only when `coroutine_clone` is enabled and the coroutine is movable
// impl Copy/Clone for Coroutine where T: Copy/Clone forall T in (upvars, witnesses)
ty::Coroutine(def_id, args) => match tcx.coroutine_movability(def_id) {
Copy link
Contributor

@lcnr lcnr Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to check should_stall_coroutine? 🤔

rn checking const Clone for a coroutine should cause a query cycle

}
}

fn evaluate_host_effect_for_copy_clone_goal<'tcx>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use SelectionContext::copy_clone_conditions instead of duplicating the match here?

We do the same in the new solver, so I'd expect either duplicating this match in both solvers or in none of them.

I guess the issue is that copy_clone_conditions only expects self types for which assembly succeeded?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the built in Copy/Clone for non-const stuff is following the "assemble if looks okay, check nested predicates during confirmation", but the const stuff is not, so there is some divide here that prevents us from deduplicating without doing some refactor on how BuiltinCandidate works...

@rustbot
Copy link
Collaborator

rustbot commented Oct 26, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@lcnr
Copy link
Contributor

lcnr commented Oct 27, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 27, 2025

📌 Commit 042018d has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 27, 2025
bors added a commit that referenced this pull request Oct 27, 2025
Rollup of 4 pull requests

Successful merges:

 - #145939 (const `select_unpredictable`)
 - #147478 (More intuitive error when using self to instantiate tuple struct with private field)
 - #147866 (Add built-in `const` impls for `Clone` and `Copy`)
 - #148153 (Fix duplicate 'the the' typos in comments)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2e575e0 into rust-lang:master Oct 27, 2025
11 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Oct 27, 2025
rust-timer added a commit that referenced this pull request Oct 27, 2025
Rollup merge of #147866 - fee1-dead-contrib:constclonebuiltin, r=lcnr

Add built-in `const` impls for `Clone` and `Copy`

cc `@compiler-errors`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants